Skip to content

Keep terminal transcript results across concurrent polls - #310

Open
codebanditssss wants to merge 1 commit into
AssemblyAI:masterfrom
codebanditssss:audit/round2-python-transcript-state
Open

codebanditssss wants to merge 1 commit into
AssemblyAI:masterfrom
codebanditssss:audit/round2-python-transcript-state

Conversation

@codebanditssss

Copy link
Copy Markdown

Fixes #308.

wait_for_completion() now awaits each poll into a local variable. If another waiter installed a terminal response while that request was in flight, it returns the existing result instead of overwriting it with the older snapshot.

No shared polling task or lock is added. HTTP errors still propagate, and cancelling one waiter does not affect the others.

Tests

tests/unit/test_async_transcript_concurrency.py uses a loopback HTTP server, public submit()/wait_for_completion() and default polling settings. It covers queued/processing then completed/error reordering, cancelling the older waiter, repeat waits, and an unrelated transcript on the same pool.

  • Unchanged source: 4 failed, 2 passed. Fixed: 6 passed.
  • Full offline unit suite: 1040 passed.
  • Ruff check/format and mypy on the changed source pass.

Bumps the version to 1.10.14. #307 uses 1.10.13, so the version may need adjusting depending on merge order.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Concurrent AsyncTranscript waits can erase an already returned terminal result

1 participant